import xlrd

# 1.打开xlsx文件
xlsx = xlrd.open_workbook('d:/Path')
# 2.获取指定tab页
tab = xlsx.sheet_by_index(0)
# 3.获取到表中行数
nrows = tab.nrows
# 4.进行循环统计操作
total = 0
count = 0
for i in range(1,nrows):
    # 拿到当前同学的班级id
    classId = tab.cell_value(i,1)
    if classId  == 100:
        total += tab.cell_value(i,2)
        count += 1
print(f"平均分：{total/count}")